package com.foreknow.service.impl;

import com.foreknow.dao.RegistlevelMapper;
import com.foreknow.entity.Registlevel;
import com.foreknow.service.RegistlevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RegistlevelServiceImpl implements RegistlevelService {

    @Autowired
    private RegistlevelMapper registlevelMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    @Override
    public int insert(Registlevel record) {
        return 0;
    }

    @Override
    public Registlevel selectByPrimaryKey(Integer id) {
        return registlevelMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Registlevel> selectAll() {
        return registlevelMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKeySelective(Registlevel record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Registlevel record) {
        return 0;
    }

    @Override
    public List<Registlevel> findAllReg(String query) {
        return registlevelMapper.findReg(query);
    }

    @Override
    public boolean deleteRegById(Integer id) {
        return registlevelMapper.deleteByPrimaryKey(id)==1;
    }

    @Override
    public int deleteRegsById(List<Integer> ids) {
        return registlevelMapper.deleteRegsById(ids);
    }

    @Override
    public List<Registlevel> quetyAll(String param) {
        return registlevelMapper.findUser(param);
    }

    @Override
    public boolean insertReg(Registlevel registlevel) {
        return registlevelMapper.insertSelective(registlevel)==1;
    }

    @Override
    public boolean updateReg(Registlevel registlevel) {
        return registlevelMapper.updateByPrimaryKeySelective(registlevel)==1;
    }

    @Override
    public Registlevel findRegById(Integer id) {
        return registlevelMapper.selectByPrimaryKey(id);
    }
}
